//
//  InterviewBaseinfoModel.m
//  Btpin
//
//  Created by Vic on 2019/4/21.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "InterviewBaseinfoModel.h"

@implementation InterviewBaseinfoModel

- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
    self.name = [UIToolsControl dataAnalysis:keyedValues[@"name"]];
    self.contact = [UIToolsControl dataAnalysis:keyedValues[@"contact"]];
    self.telephone = [UIToolsControl dataAnalysis:keyedValues[@"telephone"]];
    self.address = [UIToolsControl dataAnalysis:keyedValues[@"address"]];
    
    self.job_list = [NSMutableArray arrayWithCapacity:0];
    if (keyedValues[@"job_list"] && [keyedValues[@"job_list"] isKindOfClass:[NSArray class]] && [keyedValues[@"job_list"] count]) {
        for (NSDictionary *dic in keyedValues[@"job_list"]) {
            InterviewBaseinfoJobModel *model = [[InterviewBaseinfoJobModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.job_list addObject:model];
        }
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (id)copyWithZone:(NSZone *)zone {
    InterviewBaseinfoModel *model = [[[self class] allocWithZone:zone] init];
    model.name = self.name;
    model.contact = self.contact;
    model.telephone = self.telephone;
    model.address = self.address;
    
    model.job_list = [NSMutableArray arrayWithCapacity:0];
    if (self.job_list && self.job_list.count) {
        for (InterviewBaseinfoJobModel *tempModel in self.job_list) {
            [model.job_list addObject:[tempModel copy]];
        }
    }
    
    return model;
}

@end
